package com.chushouya.order.constants;


import com.general.framework.core.enums.IEnum;
import com.general.framework.core.lang.Strings;

import java.util.Objects;

public enum AlipayOrderChangedStatusEnum implements IEnum<String> {
    INIT("INIT", "订单创建"),
    ASSIGNED("ASSIGNED", "已分配"),
    PART_DELIVERED("PART_DELIVERED", "已下物流单"),
    PAID("PAID", "订单创建/支付成功"),
    DELIVERED("DELIVERED", "已寄件/工程师已上门"),
    RECEIVED_CONFIRM("RECEIVED_CONFIRM", "已签收"),
    MERCHANT_CONFIRMED("MERCHANT_CONFIRMED", "已质检"),
    USER_CONFIRMED("USER_CONFIRMED", "已确认"),
    USER_REJECT("USER_REJECT", "已拒绝"),
    FINISHED("FINISHED", "已完成"),
    CLOSED("CLOSED", "已关闭"),
    REFUND_CLOSED("REFUND_CLOSED", "已退款"),
    CANCEL_CLOSED("CANCEL_CLOSED", "已关闭");



    private String value;

    private String desc;

    AlipayOrderChangedStatusEnum(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static String getDesc(String status) {
        for (AlipayOrderChangedStatusEnum thisEnum : AlipayOrderChangedStatusEnum.values()) {
            if (Objects.equals(thisEnum.value, status)) {
                return thisEnum.desc;
            }
        }
        return Strings.EMPTY;
    }
    public String getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    @Override
    public String value() {
        return this.value;
    }

    @Override
    public String named() {
        return this.desc;
    }
}
